package com.yb.mini.goods.controller;

import com.yb.mini.common.common.Result;
import lombok.RequiredArgsConstructor;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * 商品服务
 *
 * @author yangbiao
 * @date: 2024/03/14
 */
@RestController
@RequiredArgsConstructor
public class GoodsController {
    private final Environment environment;

    @GetMapping("/yb/goods/{content}")
    public Result<Object> goods(@PathVariable String content) {
        return Result.success("W0rld----" + content);
    }

    @GetMapping("/yb/goods1")
    public Result<Object> goods1() {
        final String content = environment.getProperty("yb.config", String.class, "空内容");
        return Result.success("W0rld----" + content);
    }

}
